package proxy.dynamicproxy;

import org.junit.Test;
import proxy.dynamicproxy.ITeacherDao;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * @author : DuJiabao
 * @Date : 2021/3/16 11:11
 * @Project : design-pattern
 * @File : null.java
 * @Desc :
 */
public class Client {
  public static void main(String[] args) {
    ITeacherDao target = new TeacherDao();
    ProxyFactory proxyFactory = new ProxyFactory(target);
    ITeacherDao instance = (ITeacherDao) proxyFactory.getProxyInstance();
    instance.teach();
  }
}
